﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows.Media;
using Road3App.Model.CrossroadNs;

namespace Road3App.Services.Converters
{
    class CellStateConverter2 : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            CellStates state = (CellStates)value;
            Color color;

            switch (state)
            {
                case CellStates.Start: color = Colors.Green;
                    break;
                case CellStates.Finish: color = Colors.Blue;
                    break;
                case CellStates.None: color = Colors.LightGray;
                    break;
                case CellStates.Inaccessible: color = Colors.Transparent;
                    break;
                default: color = Colors.Black;
                    break;
            }

            return new SolidColorBrush(color);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
